<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");

if ($_SESSION["permission"][$categoryScreen]["View"]=="0"){
	echo "<script>alert('".$no_permit."');</script>";
	echo "<meta http-equiv = refresh ; content = '0 ; url = mainscreen.php'>";
	exit();
}

echo headerPage("Category Maintenance");
?>
<SCRIPT src="js/js_category.js"></SCRIPT>  
<script>
$(function() {
 
	$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
});
</script>
<FORM name="Act" action="<?php echo $PHP_SELF?>" method="post"> 
<INPUT type=hidden value="add" id="mode" name="mode"> 
<INPUT type=hidden value="Admin" id="user" name="user"> 
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
 
    <td width="10" id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1014" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
                            <td>
								<?php  if ($_SESSION["permission"][$categoryScreen]["Add"]=="1") {?>
									<a href="javascript:void('0');" id="btnAdd">
									<span class="icon_add"></span>Add
									</a>
								<?php }?>
							</td>
							   <td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>
                        </tr>
                        </table>
                    </div>
                      <div class="header">
                        Category Maintenance
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
                    <table width="100%" id='searchdata'>
                        <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20">
                            Category Name: 
                            </td>
							<td width="85%" align=left >
							<input id="txtCategoryName_s"  title="Filter by Category "  type="text"  	size=40 name="code" class="boxItem" />
							</td>
                         </tr>
						 <tr><td/><td>
						 <a href="javascript:void('0');" id="btnSearch"><img src="./images/btn-search.gif" border=0/></a> </td></tr>
						 <tr><td colspan="2"></tr>
                    </table>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
								<th width="5%">No.</th>
								<th style="display:none">ID</th>
								<th class="title" width="50%">Category Name</th>
								<th  class="title" width="30%" nowrap="nowrap"> Status</th>
								<th  class="title" width="5%" nowrap="nowrap">Edit</th>
								<th  class="title" width="5%" nowrap="nowrap">Del</th>
                      </tr>
                    </thead>
                   <tbody>
                     </tbody>
                     <tfoot>
                         <tr>
                            <td colspan="5">
								<div class="boxfooter">
								<div id="paging_btn"> </div>
								 <div class="totalpage">Total : <span id="rowCount"></span>&nbsp;&nbsp;rows</div>
								
							</div>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10" id='rightboder' style="border-right:2px solid #facb0c;">&nbsp;</td>
  </tr>
</table>
 </FORM>
 
<div id="dialog-confirm" title="Confirm delete?">
	<p><span class="ui-icon ui-icon-alert" 
		style="float:left; margin:0 7px 20px 0;">
		</span>Are you sure to delete this category?</p>
</div>
<div id="dialog-form" >
	<p class="validateTips">* fields are required.</p>
	<form>
	<table cellpadding="0" cellspacing="0" border="0" width="100%" class="fieldset">
		<tr>
			<td width="30%"><label for="name" >Category Name *</label></td>
			<td width="70%"><input type="text" name="CatName"  id="CatName" class="text ui-widget-content ui-corner-all" /></td></tr>
		<tr>
			<td><label for="email">Status </label></td>
			<td>
				<label>
					<input type="radio" id="A" name="Status" checked value="1">Actived</label>
				<label>	<input type="radio" id="B" name="Status" value="0">Disabled
				</label>
			</td>
		</tr>
	</table>
</form>
</div>
<?php echo footer();?>